home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue28 / excel / EXCEL.ZIP / README.TXT < prev    next >
Encoding:
Text File  |  1997-07-24  |  5.8 KB  |  175 lines

  1. ====================
  2. TExcel component 3.1
  3. ====================
  4. TExcel is a component to produce output tables directly into
  5. MS Excel, including formatting, commands, macro calls, etc.
  6.  
  7. Demo project is attached to show how easy to drive it.
  8. The demo project creates the component explicitly so it can be
  9. tried without installing the component.
  10.  
  11.  
  12. Files:
  13.         EXCELS.PAS      Component source
  14.         EXCEL.DCR       Icon for Delphi 1.0
  15.         EXCEL.D32       Icon for Delphi 2.0/3.0
  16.         EXCELDEM.DPR    Demo project
  17.         EXCELDEM.RES    Demo project resource
  18.         EXCELTOP.PAS    Demo dialog
  19.         EXCELTOP.DFM    Demo dialog format
  20.         TEXCEL.XLS      Demo Excel macro collection
  21.         README.TXT      This text
  22.  
  23. Thanks to Stefan Hoffmeister the sophisticated version 
  24. named TAdvExcel is available at the following sites:
  25. http://sunsite.icm.edu.pl/delphi/
  26. http://carbohyd.siobc.ras.ru/torry/
  27.  
  28.  
  29. ======================
  30. About GetCell function
  31. ======================
  32. Though TExcel is to produce output to Excel sometimes input is
  33. also needed. GetCell retrieves the contents of the specified cell.
  34. It opens a new DDE conversation to get the contents of the cell 
  35. then resets the original DDE link. When many cells needed it is 
  36. recommended to write an other method to make it more efficient.
  37.  
  38.  
  39. ===========================================
  40. About Wait procedure and WaitAfter property
  41. ===========================================
  42. Both needed when huge amount of data must be transferred to Excel.
  43. When a program transfers more thousands in a loop the DDE channel
  44. and Excel is not able to process them and a slow down happens.
  45. The process can be speeded up by using Wait and/or WaitAfter.
  46. The optimal speed is when the program transfers data
  47. on the same speed as Excel is able to process it.
  48.  
  49. The Wait procedure waits for Excel to be ready and resets the
  50. transfer counter. Wait is automatically called when the number
  51. of transfers exceeds the value specified by WaitAfter.
  52. The appropriate WaitAfter value depends on the configuration
  53. and the amount of data to be transferred. The more data needs
  54. the smaller value. The Demo project helps to calibrate the
  55. WaitAfter value. Sometimes the calibration can double the speed
  56. especially on smaller machines where memory is the bottle neck.
  57.  
  58. ==================
  59. Excel DDE commands
  60. ==================
  61. To tell the truth I have never seen documentations of Excel DDE
  62. commands but I have found that most of Excel 4.0 macro instructions
  63. work as DDE commands. So all you have to do make a macro using the
  64. desired instruction in Excel 4.0 format and use it as DDE command.
  65. (With Excel 5.0 you can record macro in 4.0 format.)
  66. The demo project shows some samples in the "Command" combo box.
  67.  
  68.  
  69. =================================================================
  70. Instead of documentation here are some words about the interface.
  71. =================================================================
  72.  
  73. procedure Connect;
  74.   To connect Excel.
  75.  
  76. procedure Disconnect;
  77.   To disconnect Excel.
  78.  
  79. procedure Wait;
  80.   To wait for Excel to be ready. See section "About Wait...".
  81.  
  82. function Request(const Item: string): string;
  83.   To request for a DDE item.
  84.   Use "SysItems" to get the available items.
  85.  
  86. procedure Exec(const Cmd : string);
  87.   To execute Excel commands. See section "Excel DDE Commands".
  88.  
  89. procedure Run(const Mn: string);
  90.   To execute a macro of the open macro file.
  91.  
  92. procedure Filter(const Txt: string); virtual;
  93.   To replace the current cell with filtering.
  94.  
  95. procedure Select(Row, Col: Integer);
  96.   To select a cell of the active Excel sheet.
  97.  
  98. procedure PutStr(Row, Col: Integer; const s: string);
  99.   To replace the cell with string.
  100.  
  101. procedure PutExt(Row, Col: Integer; e: Extended);
  102.   To replace the cell with real number.
  103.  
  104. procedure PutInt(Row, Col: Integer; i: Longint);
  105.   To replace the cell with integer.
  106.  
  107. procedure PutDay(Row, Col: Integer; d: TDateTime);
  108.   To replace the cell with date value.
  109.  
  110. function GetCell(Row, Col: Integer): string;
  111.   To get the cell contents. See section "About GetCell".
  112.  
  113. procedure OpenMacroFile(const Fn: TFileName; Hide: Boolean);
  114.   To specify a macro file.
  115.   Needed only when macros are going to call.
  116.  
  117. procedure CloseMacroFile;
  118.    To close an opened macro file.
  119.    Only one macro file can be opened at the same time.
  120.  
  121. procedure StartTable(Create: Boolean);
  122.   To start sending data. It writes a warning message into
  123.   cell (1,1), minimizes Excel and starts transfer counter.
  124.  
  125. procedure EndTable;
  126.   To finish the table. It clears the warning from
  127.   cell (1,1) and bring up the result i.e. restore Excel.
  128.  
  129. property DDE: TDdeCLientConv;
  130.   To handle DDE directly.  (Read only)
  131.   Normally not needed.
  132.  
  133. property Connected: Boolean;
  134.   To check connection.
  135.  
  136. property Ready: Boolean;
  137.   To check Excel status. (Read only)
  138.  
  139. property Selection: string;
  140.   To get current selection. (Read only)
  141.  
  142. property ExeName: TFileName;
  143.   To set Excel path.
  144.  
  145. property Decimals: Integer;
  146.   To specify number format for real numbers.
  147.  
  148. property Separator: Char;
  149.   To specify decimal separator for real numbers.
  150.  
  151. property WaitAfter: Integer;
  152.   To calibrate waiting for Excel. See section "About Wait...".
  153.  
  154. property OnClose: TNotifyEvent;
  155.   Event handler called when Excel is connected.
  156.  
  157. property OnOpen: TNotifyEvent;
  158.   Event handler called when Excel is disconnected.
  159.  
  160.  
  161. --------------------------------------
  162. --------------------------------------
  163.  
  164. If you find the component useful I want to hear about you!
  165.  
  166. --------------------------------------
  167. --------------------------------------
  168. Tibor F. Liska     MTA SZTAKI
  169.                    Lagymanyosi utca 11
  170.                    1111 Budapest
  171.                    Hungary
  172. Fax:    +36-1-209-5288
  173. Tel:    +36-1-209-5284
  174. E-mail: liska@sztaki.hu
  175.